<!DOCTYPE html>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.prime.com.tr/ui"
	xmlns:nf="http://novelfaces.be/jsf/comp"
	xmlns:nfsc="http://novelfaces.be/showcase/jsf/comp"
	xmlns:sp="http://java.sun.com/jsf/composite/source_panel">

<div class="fieldGroup">
	<h:outputLabel id="inputLabel" for="inputText"
		value="#{rb.input_text_label}" />
	<nf:inputText id="inputText"
		value="#{inputTextManagedBean.inputValue}" pattern="[a-z]*"
		required="true" placeholder="I'm html5 enabled" />
	<h:commandButton id="button" value="Try me"
		action="#{inputTextManagedBean.submit}" />
</div>

<div class="ui-datatable">
	<table>
		<thead>
			<tr>
				<th class="ui-state-default"></th>
				<th class="ui-state-default">#{rb.pattern}</th>
				<th class="ui-state-default">#{rb.placeholder}</th>
				<th class="ui-state-default">#{rb.required}</th>
			</tr>
		</thead>
		<tbody class="ui-datatable-data">
			<tr class="ui-widget-content">
				<td>value</td>
				<td><span id="pattern"></span></td>
				<td><span id="placeholder"></span></td>
				<td><span id="required"></span></td>
			</tr>
			<tr class="ui-widget-content">
				<td>supported by your browser?</td>
				<td><span id="patternSupport"></span></td>
				<td><span id="placeholderSupport"></span></td>
				<td><span id="requiredSupport"></span></td>
			</tr>
		</tbody>
	</table>
</div>

<script>
	jQuery(function() {
		jQuery("#pattern").text(jQuery("#mainForm\\:inputText").attr('pattern'));
		jQuery("#placeholder").text(jQuery("#mainForm\\:inputText").attr('placeholder'));
		jQuery("#required").text(jQuery("#mainForm\\:inputText").attr('required'));
		jQuery("#patternSupport").text(Modernizr.input.pattern);
		jQuery("#placeholderSupport").text(Modernizr.input.placeholder);
		jQuery("#requiredSupport").text(Modernizr.input.required);
		
	});
</script>
	
</ui:composition>